<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
          <h:outputStylesheet name="default.css" library="css" />
    </h:head>
    <h:body>
        <ui:composition>
            <h:form >
                 <p:outputPanel autoUpdate="true">
                <p:toolbar >
                    <p:toolbarGroup align="left">
                         <p:commandButton value="#{bundle.btnPrint}" icon="ui-icon-document"
                                      action="#{depositReportBean.executeReport()}" ajax="false"    />            
                        
                    </p:toolbarGroup>
                </p:toolbar>
                </p:outputPanel>
                <h:panelGrid  style="vertical-align: top" id="displayDepositreport" styleClass="addELIT" cellpadding="0" columns="2" columnClasses="panelGridId,panelGridId">
                    <p:panel header="Jenis Laporan" style="margin: 0 0 0 0;">
                    
                        <p:dataTable var="rpt" value="#{depositReportBean.availableMenu}" selection="#{depositReportBean.selectedReport}" selectionMode="single"
                                     rowKey="#{rpt.menuId}"  scrollable="true" scrollHeight="350">
                              <p:ajax event="rowSelect" 
                           update=":#{utilityBean.findClientId('pnlReportFilterDeposito')}" />  
                             <p:column style="width:auto" rendered="false" >
                                <f:facet name="header">ID</f:facet>
                                <h:outputText value="#{rpt.menuId}" />
                            </p:column>
                            <p:column style="width:250px" sortBy="#{rpt.menuName}">
                                <f:facet name="header">Nama Laporan</f:facet>
                                <h:outputText value="#{rpt.menuName}" />
                            </p:column>
                        </p:dataTable>
                    </p:panel>
                    <p:panel header="Filter">
                    <p:panelGrid styleClass="noBorders"  id="pnlReportFilterDeposito" rendered="#{depositReportBean.selectedReport!=null}">
                            <p:row rendered="#{reportCfgBean.showComponent(depositReportBean.selectedReport.menuId, 'TRANSDATE1;')}">
                                <p:column><h:outputLabel value="Dari" /></p:column>                                
                                <p:column>: <p:calendar pattern="dd/MM/yyyy" size="8" showOn="button" value="#{depositReportBean.reportFilter.transDate1}"/></p:column>                                
                            </p:row>
                            <p:row rendered="#{reportCfgBean.showComponent(depositReportBean.selectedReport.menuId, 'TRANSDATE2;')}">
                                <p:column><h:outputLabel value="Sampai" /></p:column>                                
                                <p:column>: <p:calendar pattern="dd/MM/yyyy" size="8" showOn="button" value="#{depositReportBean.reportFilter.transDate2}" /></p:column>                                
                            </p:row>
                            <p:row rendered="#{reportCfgBean.showComponent(depositReportBean.selectedReport.menuId, 'CIF;')}">
                                <p:column><h:outputLabel value="#{bundle.cif}"/></p:column>                                
                                <p:column>: <p:inputText label="#{bundle.cif}" id="filCifDepositReport" value="#{depositReportBean.reportFilter.cif}"  />
                            &nbsp;<p:commandButton icon="ui-icon-search" iconPos="center" styleClass="btnSmall"
                                            update="footDepositReportLookupCust" 
                                            process="@this" immediate="true" 
                                            action="bilyetBean.showDialog('dlgDepositReportLookupCust')}">
                                        <f:setPropertyActionListener target="#{depositReportBean.showLookup}" value="#{true}" />
                                    </p:commandButton></p:column>                                
                            </p:row>
                           
                            <p:row rendered="#{reportCfgBean.showComponent(depositReportBean.selectedReport.menuId, 'USER;')}">
                                <p:column><h:outputLabel value="#{bundle.user}" /></p:column>                                
                                <p:column>: <p:inputText label="#{bundle.user}" /></p:column>                                
                            </p:row>
                            <p:row rendered="#{reportCfgBean.showComponent(depositReportBean.selectedReport.menuId, 'MONTHYEAR;')}">
                                <p:column><h:outputLabel value="#{bundle.period}" /></p:column>                                
                                <p:column>: 
                                    <h:panelGroup >
                                        <p:selectOneMenu value="#{depositReportBean.reportFilter.month}" >
                                            <f:selectItems value="#{reportCfgBean.availableMonth}" />  
                                        </p:selectOneMenu>
                                        <p:spinner min="2012" size="4"  style="position:absolute" value="#{depositReportBean.reportFilter.year}" />
                                    </h:panelGroup>
                                </p:column>                                
                            </p:row>
                            <p:row rendered="#{reportCfgBean.showComponent(depositReportBean.selectedReport.menuId, 'PRODUCT;')}">
                                <p:column><h:outputLabel value= "#{bundle.deproduct}" /></p:column>                                
                                <p:column>: 
                                    <h:panelGroup >
                                        <p:selectOneMenu value="#{depositReportBean.reportFilter.productId}" label="#{bundle.deproduct}"                                             
                                                        style="width: 151px;">
                                            <f:selectItem itemLabel="#{bundle.Select} #{bundle.deproduct}"  itemValue="-1" />
                                            <f:selectItems value="#{bilyetBean.avblProd}" />                                        
                                        </p:selectOneMenu>
                                    </h:panelGroup>
                                </p:column>                                
                            </p:row>
                           
                    </p:panelGrid>
                        </p:panel>
                </h:panelGrid>
            </h:form>
        </ui:composition>
    </h:body>
</html>

